package com.itheima.logAdvice;

import org.aspectj.lang.ProceedingJoinPoint;

public class BuyLogAdvice {
    public Object around(ProceedingJoinPoint pjp ){
        Double proceed = 0.0;
        Double args = (Double) pjp.getArgs()[0];
        System.out.println("商品价格为"+args);
        args=args*0.5;
        try {
            proceed = (Double) pjp.proceed(new Double[]{args});
            //proceed = (Double) pjp.proceed(new Double[]{args});
            System.out.println("原本积分为"+proceed);
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        proceed*=2;
        System.out.println("活动积分为"+proceed);
        return proceed;
    }
}
